home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Snippets / QuickDraw / Pallete DA / Pallet.r < prev    next >
Encoding:
Text File  |  1993-01-18  |  1.9 KB  |  67 lines  |  [TEXT/MPS ]

  1. /*
  2.  * File Memory.r
  3.  *
  4.  * Copyright Apple Computer, Inc. 1985-1987
  5.  * All rights reserved.
  6.  *
  7.  * Sample desk accessory resource file.
  8.  * This incorporates the DRVR header information (defined here)
  9.  * with the linked code (stored as a 'DRVW' resource in the link command)
  10.  */
  11.  
  12. #include "Types.r"                /* To get system types */
  13. #include "MPWTypes.r"            /* To get 'DRVW' type */
  14.  
  15. #define DriverID    12
  16.  
  17. #ifdef NOASM_BUILD
  18. /*
  19.  * This will produce a DRVR resource from the special DRVW type.
  20.  * (this eliminates the need for using the Assembler to create
  21.  *    the DA header, but makes it impossible to use SADE, oops!)
  22.  *
  23.  * Note that the ID 12 is irrelevant, since the Font/DA Mover
  24.  * will renumber it to something else when installing it anyway.
  25.  *
  26.  * The leading NUL in the resource name is required to
  27.  * conform to the desk accessory naming convention.
  28.  *
  29.  * The resource is declared purgeable.    If the code were to
  30.  * do funky things like SetTrapAddress calls (requiring the code to
  31.  * be around at all times), we would have to set it nonpurgeable.
  32.  */
  33.  
  34. type 'DRVR' as 'DRVW';            /* Map 'DRVW' => 'DRVR' */
  35.  
  36. resource 'DRVR' (DriverID, "\0x00Pallet", purgeable) {
  37.     /*
  38.      * DRVR flags
  39.      */
  40.     dontNeedLock,            /* OK to float around, not saving ProcPtrs */
  41.     needTime,                /* Yes, give us periodic Control calls */
  42.     dontNeedGoodbye,        /* No special requirements */
  43.     noStatusEnable,
  44.     ctlEnable,                /* Desk accessories only do Control calls */
  45.     noWriteEnable,
  46.     noReadEnable,
  47.     2*60,                    /* drvrDelay - Wake up every 5 seconds */
  48.     updateMask,             /* drvrEMask - This DA only handles update events */
  49.     0,                        /* drvrMenu - This DA has no menu */
  50.     "Memory",                /* drvrName - This isn't used by the DA */
  51.     /*
  52.      * This directive inserts the contents of the DRVW resource
  53.      * produced by linking DRVRRuntime.o with our DA code
  54.      */
  55.     $$resource("Pallet.DRVW", 'DRVW', 0)
  56. };
  57. #endif
  58.  
  59. resource 'WIND' (0xC000 | (DriverID << 5), "Pallet") {
  60.     {100, 100, 355, 355},
  61.     noGrowDocProc,
  62.     visible,
  63.     goAway,
  64.     0x0,
  65.     "Pallet"
  66. };
  67.